import { App as VM } from 'vue'
import { Button, Cell, Icon, Search, Empty, Tab, Tabs, Tabbar, TabbarItem, Overlay, CellGroup, Loading } from 'vant'

const plugins = [Button, Cell, Icon, Search, Empty, Tab, Tabs, Tabbar, Loading, Overlay, CellGroup, TabbarItem]

const useComponents = [Empty]
export const vantPlugins = {
  install: function (vm: VM) {
    plugins.forEach(item => {
      vm.component(item.name, item)
    })
    useComponents.forEach(item => {
      vm.use(item)
    })
  }
}
